package com.youdianstar.app.util.map;

import android.content.Context;

import com.google.android.gms.maps.GoogleMap;
import com.google.maps.android.clustering.ClusterItem;
import com.google.maps.android.clustering.ClusterManager;
import com.google.maps.android.collections.MarkerManager;

/**
 * File: BrsClusterManager
 * Author: 82149 Create: 2021/12/3 19:16
 * Changes (from 2021/12/3)
 * --------------------------------------------------
 * description:
 * ---------------------------------------------------
 */
public class BrsClusterManager<T extends ClusterItem> extends ClusterManager<T> {
    public interface MapCameraChangeListener {
        void onCameraIdle();
    }

    public BrsClusterManager(Context context, GoogleMap map) {
        super(context, map);
    }

    public BrsClusterManager(Context context, GoogleMap map, MarkerManager markerManager) {
        super(context, map, markerManager);
    }

    private MapCameraChangeListener listener = null;

    public MapCameraChangeListener getListener() {
        return listener;
    }

    public void setListener(MapCameraChangeListener listener) {
        this.listener = listener;
    }

    @Override
    public void onCameraIdle() {
        super.onCameraIdle();
        if (null!=listener)
            listener.onCameraIdle();
    }
}
